(define (for-each f l)
  (if (null? l)
      #t
      (begin (f (car l))
             (for-each f (cdr l)))))

(define (for-each-between f comma list)
  (if (null? list)
      #t
      (if (null? (cdr list))
	  (f (car list))
          (begin
            (f (car list))
            (begin (comma 1)
                   (for-each-between f comma (cdr list)))))))

(define (test)
  (lambda (i)
    (for-each (lambda (i)
                (begin (print 'DOCHY!)
                       (print i)))
              (cons i (cons (+ i 1) (cons (+ i 2) '()))))))

(define (test-2)
  (lambda (i)
    (for-each-between
     (lambda (i)
       (begin (print 'HAPPY!)
              (print i)))
     (lambda (n) (print 'LUCKY! ))
     (cons i (cons (+ i 1) (cons (+ i 2) '()))))))

(define scm-main
  (begin
    (for-each (test-2) (cons 67676767 (cons 252525 (cons 484848 '()))))
    (for-each (test) (cons 67676767 (cons 252525 (cons 484848 '()))))))
